home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROCS.ZIP / TAB2REC.ICN < prev    next >
Text File  |  1992-11-20  |  788b  |  35 lines

  1. ############################################################################
  2. #
  3. #    File:     tab2rec.icn
  4. #
  5. #    Subject:  Procedure to insert tab-separated strings in records
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 2, 1991
  10. #
  11. ###########################################################################
  12. #
  13. #     This procedure to takes tab-separated strings and inserts them
  14. #  into fields of a record.
  15. #
  16. #  Vertical tabs in strings are converted to carriage returns.
  17. #
  18. #  (Works for lists too.)
  19. #
  20. ############################################################################
  21.  
  22. procedure tab2rec(s,x)
  23.    local i
  24.  
  25.    i := 0
  26.  
  27.    s ? {
  28.       while x[i +:= 1] := map(tab(upto('\t') | 0), "\v", "\n") do
  29.          move(1) | break
  30.       }
  31.  
  32.    return
  33.  
  34. end
  35.